[OFFLINE CONTENT]
Comment: .NET Application Setup Project
 
Comment: The variable INCLUDEOTHERINSTALLS is used to either run or not run other installs
Comment: When building an "upgrade" install set this to FALSE
Comment: This acts like a compiler variable because custom compiler variables are only allowed in a higher version
Set Persistent Variable INCLUDEOTHERINSTALLS to TRUE
Set Variable LocalDB_Exist to FALSE
Set Variable MY_USERNAME to UNKNOWN
Get System Setting Logged on User Name into MY_USERNAME
 
[DEFINE REGION: Application Updates]
[END REGION]
Comment: MessageBox: After updates, After updates
 
[DEFINE REGION: Check Application Requirements]
Get System Setting Windows 7 into CHECKSYSTEM
if Variable CHECKSYSTEM not Equals TRUE
  MessageBox: $TITLE$ Setup Error, This product requires at least Windows 7.$NEWLINE$$NEWLINE$Setup cannot continue.
  Terminate Installation
end
[END REGION]
 
[DEFINE REGION: Check/Install Application Pre-Requisites]
 
[DEFINE REGION: Check Application Pre-Requisites]
Comment: Check setup pre-requisites
Set Variable PREREQ to FALSE
Set Variable PRELIST to 
[compiler if Variable BUILDMODE not Equals PATCH]
if Variable NEEDSUPGRADE Equals TRUE
  Set Variable PREREQ to TRUE
  Set Variable PRELIST to $PRELIST$$NEWLINE$Previous Version Uninstallation
end
Include Script: checknet452_x86x64
[compiler end]
[END REGION]
 
[DEFINE REGION: Install Application Pre-Requisites]
Comment: Set Variable WIZARD to 
Comment: Install setup pre-requisites
if Variable PREREQ not Equals FALSE
  Comment: Display Dialog: prereq, wait for dialog to return (modal)
  if Variable WIZARD Equals CANCEL
    Terminate Installation
  end
  Comment: Display Dialog: progressprereq, use as progress dialog (non-modal)
  [compiler if Variable BUILDMODE not Equals PATCH]
  if Variable NEEDSUPGRADE Equals TRUE
    Set Variable REMOVEOLD to 
    Set Variable ERROROLD to 
    Install/Remove MSI Package $PRODUCTCODE$[REMOVE=ALL] (get result into variable REMOVEOLD)
    if Variable REMOVEOLD Equals ERROR
      MessageBox: $TITLE$ Setup, Unable to uninstall old version of $TITLE$. Please uninstall it yourself using Control Panel Add-Remove Programs before attempting to install this product.$NEWLINE$$NEWLINE$$ERROROLD$
      Terminate Installation
    end
    if Variable REMOVEOLD Equals REBOOT
      MessageBox: $TITLE$ Setup, Your computer needs to be restarted before $TITLE$ Setup can continue.$NEWLINE$$NEWLINE$Please save your work in all running programs and click OK to restart your computer. Setup will resume once your computer restarts.$NEWLINE$$NEWLINE$If you click CANCEL, setup will exit. You will have to run setup again at a later time to install $TITLE$.
      if Variable REBOOTNOW Equals OK
        Reboot Computer and Resume Setup
      else
        Terminate Installation
      end
    end
    Set Variable MAINTENANCE to FALSE
  end
  Comment: [DEFINE WEB MEDIA Microsoft .NET Framework 4.52 (x86 and x64)]
  Include Script: setupnet452_x86x64
  [compiler end]
  Hide Dialog
end
[END REGION]
 
[END REGION]
 
[DEFINE REGION: Define Setup Globals]
Comment: Define Setup Components
Define Component: Test System 2
Set Variable ISWIN64 to False
Set Persistent Variable FX to FADE
Get System Setting Windows in 64 bit Mode into ISWIN64
if Variable ISWIN64 Equals TRUE
  Set x64 - Native 64 bit Windows, AMD64 and EM64T Architectures - installation mode
end
Comment: Set Win32 - Native 32 bit Windows and Windows 32 on Windows 64 (WOW64) - installation mode
 
Comment: Initialize Setup Globals
Get System Setting Windows NT Kernel (NT4, 2000, XP, 2003, Vista, 2008, 7, 2008 R2, 8, 2012, 8.1, 2012 R2, 10, 2016) into ISNT
Get Folder Location Other->Local Application Data into MYLOCALAPPDATA
Get Folder Location System->Application Data Directory into MYAPPDATA
Get Folder Location System->Program Files Directory into PROGRAMFILES
Get Common Folder Location System->Program Files Directory into COMMONFILES
Get Common Folder Location Start Menu->Programs Group into SHORTCUTFILESALL
Get Folder Location Start Menu->Programs Group into SHORTCUTFILES
if Variable SHORTCUTFILESALL Equals 
  Set Variable SHORTCUTFILESALL to $SHORTCUTFILES$
end
Get Folder Location System->Desktop Directory into DESKTOPDIR
Get Folder Location System->Windows Directory into WINDIR
Get Folder Location System->System Directory into WINSYSDIR
Get Folder Location Taskbar->Quick Launch Directory into QUICKLAUNCHDIR
Get Folder Location WWW->WWWRoot into WWWROOTDIR
Set Persistent Variable ProgramData to c:\ProgramData
 
Set Persistent Variable LOCALAPPDRIVE to 
Get Folder Location Other->Local Application Data into LOCALAPPDRIVE
Extract Parent Drive: LOCALAPPDRIVE
Set Variable MY_DOESINSTALLDIREXIST to FALSE
Set Variable MY_INSTALLDIRFILE to $LOCALAPPDRIVE$USERS\PUBLIC\INSTALLDIR.TXT
 
[END REGION]
 
[DEFINE REGION: Setup User Interview]
if Variable MAINTENANCE Equals TRUE
  GoTo Label: Maintenance
else
  [compiler if Variable BUILDMODE not Equals PATCH]
  Comment: First Time Install
  Set Persistent Variable TARGETDIR to $MYAPPDATA$\FLFIllustration\ProgramFiles
  Set Variable STARTMENU to $TITLE$
  [compiler end]
end
 
label: Welcome Dialog
Comment: Display Dialog: welcome, wait for dialog to return (modal)
if Variable WIZARD Equals CANCEL
  GoTo Label: Main Install
end
[compiler if Variable BUILDMODE not Equals PATCH]
label: License Check
Display Dialog: licensecheck, wait for dialog to return (modal)
if Variable WIZARD Equals BACK
  GoTo Label: Welcome Dialog
else
  if Variable WIZARD Equals CANCEL
    GoTo Label: Main Install
  end
end
label: ReadMe Information
Comment: Display Dialog: readme, wait for dialog to return (modal)
if Variable WIZARD Equals BACK
  GoTo Label: License Check
else
  if Variable WIZARD Equals CANCEL
    GoTo Label: Main Install
  end
end
label: User Registration
Comment: Display Dialog: registration, wait for dialog to return (modal)
if Variable WIZARD Equals BACK
  GoTo Label: ReadMe Information
else
  if Variable WIZARD Equals CANCEL
    GoTo Label: Main Install
  end
end
label: Setup Type
Comment: Display Dialog: setuptype, wait for dialog to return (modal)
if Variable WIZARD Equals BACK
  GoTo Label: User Registration
else
  if Variable WIZARD Equals CANCEL
    GoTo Label: Main Install
  end
end
Comment: TO-DO: Customize your minimum setup here
if Variable MINIMUM Equals TRUE
  Deselect Component: Test System 2
else
  if Variable COMPLETE Equals TRUE
    Select Component: Test System 2
  end
end
label: Custom Setup
Comment: Display Dialog: componentstree (if variable PERSONALIZED is TRUE), wait for dialog to return (modal)
if Variable WIZARD Equals BACK
  GoTo Label: Setup Type
else
  if Variable WIZARD Equals CANCEL
    GoTo Label: Main Install
  end
end
label: Destination Directory
Comment: Display Dialog: destination, wait for dialog to return (modal)
if Variable WIZARD Equals BACK
  GoTo Label: Custom Setup
else
  if Variable WIZARD Equals CANCEL
    GoTo Label: Main Install
  end
end
label: Start Menu
Comment: Display Dialog: startmenu, wait for dialog to return (modal)
if Variable WIZARD Equals BACK
  GoTo Label: Destination Directory
else
  if Variable WIZARD Equals CANCEL
    GoTo Label: Main Install
  end
end
[compiler end]
label: Start Installation
Comment: Display Dialog: startinstallation, wait for dialog to return (modal)
if Variable WIZARD Equals BACK
  [compiler if Variable BUILDMODE not Equals PATCH]
  GoTo Label: Start Menu
  [compiler else]
  GoTo Label: Welcome Dialog
  [compiler end]
else
  GoTo Label: Main Install
end
 
label: Maintenance
Comment: Maintenance Install/Uninstall
wizard loop
Display Dialog: maintenance, wait for dialog to return (modal)
Display Dialog: componentstree (if variable MODIFY is TRUE), wait for dialog to return (modal)
Display Dialog: startinstallation, wait for dialog to return (modal)
end
[END REGION]
 
[DEFINE REGION: Process (Un)Installation]
label: Main Install
Comment: Exit Setup if Wizard Loop cancelled
if Variable WIZARD Equals CANCEL
  Terminate Installation
end
 
Comment: Prepare to install
Set Variable PROGRESSTEXT to Installing $TITLE$
Set Variable SUCCESS to 
Set Variable LASTERROR to 
Comment: Set Persistent Variable ALLUSERS to FALSE
Set Persistent Variable ALLUSERS to FALSE
if Variable ALLUSERS Equals TRUE
  Set Variable SHORTCUTFOLDER to $SHORTCUTFILESALL$\$STARTMENU$
else
  Set Variable SHORTCUTFOLDER to $SHORTCUTFILES$\$STARTMENU$
end
Display Dialog: progress, use as progress dialog (non-modal)
 
Comment: Modify Target System
[DEFINE REGION: Perform Uninstallation]
if Variable REMOVE Equals TRUE
  Comment: Uninstall product
  Comment: TO-DO: Insert any additional uninstall commands here
  Delete Scheduled Task $TITLE$ Updates - $MY_USERNAME$
  Set Variable MY_DOESINSTALLDIREXIST to FALSE
  Set Variable MY_DOESUPDATEFILEEXIST to FALSE
  Set Variable MY_INSTALLEDUPDATES to UNKNOWN
  Does File Exist $MY_INSTALLDIRFILE$ (get result into variable MY_DOESINSTALLDIREXIST)
  if Variable $MY_DOESINSTALLDIREXIST$ Equals TRUE
    Read from Text File $MY_INSTALLDIRFILE$ into Variable MY_INSTALLEDUPDATES
    Delete Files $LOCALAPPDRIVE$USERS\PUBLIC\INSTALLDIR.TXT (when uninstalling)
    Does File Exist $MY_INSTALLDIRFILE$\installedupdates.dat (get result into variable MY_DOESUPDATEFILEEXIST)
    if Variable $MY_DOESUPDATEFILEEXIST$ Equals TRUE
      Delete Files $MY_INSTALLDIRFILE$\installedupdates.dat (when uninstalling)
    end
  end
  Apply Uninstall (get result into variable SUCCESS)
  Set Variable PROGRESS to 100
else
  [END REGION]
  [DEFINE REGION: Perform First Time or Maintenance Installation]
  Comment: Install/Re-Install product
  Create Shortcut $SHORTCUTFOLDER$\Uninstall #TITLE# to $UNINSTALLLINK$
  Install Files C:\ProComp\Projects\ProCompIllustration\ProCompIllustration\bin\Release\ProCompIllustration.exe to $TARGETDIR$
  Create Shortcut $SHORTCUTFOLDER$\Test System 2 to $TARGETDIR$\ProCompIllustration.exe
  Get Folder Location Start Menu->Start Menu Group into SHORTCUTROOT
  Create Shortcut $SHORTCUTROOT$\Test System 2 to $TARGETDIR$\ProCompIllustration.exe
  Create Shortcut $QUICKLAUNCHDIR$\Test System 2 to $TARGETDIR$\ProCompIllustration.exe, Pin to Start Menu, Pin to Start Screen
  Create Shortcut $DESKTOPDIR$\Test System 2 to $TARGETDIR$\ProCompIllustration.exe
  Does File Exist $PROGRAMFILES$\Microsoft SQL Server\120\Tools\Binn\SqlLocalDB.exe (get result into variable LocalDB_Exist)
  Comment: [DEFINE WEB MEDIA Test System 2]
  Get Component Test System 2 Selection State into Variable SELECTED
  if Variable SELECTED Equals TRUE
  end
  Comment: TO-DO: Insert any additional install commands here
  [compiler if Variable BUILDMODE Equals PATCH]
  Apply Patch (get result into variable SUCCESS)
  [compiler else]
  if Variable ADVERTISE Equals TRUE
    Apply Advertised (get result into variable SUCCESS)
  else
    Create Folder $MYAPPDATA$\FLFIllustration
    Create Folder $MYAPPDATA$\FLFPPR
    Create Folder $MYAPPDATA$\FLFIllustration\SavedCases
    Create Folder $MYAPPDATA$\FLFIllustration\OutputReports
    Create Folder $MYAPPDATA$\FLFFiles
    Apply Install (get result into variable SUCCESS)
    if Variable SUCCESS not Equals ERROR
      if Variable SUCCESS not Equals CANCEL
        if Variable INCLUDEOTHERINSTALLS Equals TRUE
          if Variable LocalDB_Exist Equals FALSE
            if Variable ISWIN64 Equals TRUE
              Comment: MessageBox: Here, Copied FROM $UPDATEPATH_NEW$
              Comment: MessageBox: Here, Copied to $FLFFILES$
            else
            end
          end
          Sleep for 2000 milliseconds
          Comment: Set Variable REBOOTCOMPUTER To True
          Comment: Set Variable Success to REBOOT
          Comment: Set Variable NATIVE_ENGINE to TRUE
          Comment: Set Variable NATIVE_ENGINE to FALSE
        end
      end
    end
  end
  [compiler end]
  Set Variable PROGRESS to 100
end
[END REGION]
[END REGION]
Comment: Grant Complete Access to File System Object "$ProgramData$\flfillustration"
 
[DEFINE REGION: Finish Setup]
Comment: End of Installation
Hide Dialog
Comment: Set Variable RUNAPP to False
Display Dialog: finish, wait for dialog to return (modal)
if Variable SILENT Equals FALSE
  if Variable REBOOTCOMPUTER Equals TRUE
    if Variable SUCCESS Equals REBOOT
      Reboot Computer
    end
  end
  if Variable RUNAPP Equals TRUE
    if Variable REMOVE Equals FALSE
      if Variable SUCCESS Equals COMPLETE
        Comment: TO-DO: Insert command that starts your application here
        Run Program $TARGETDIR$\ProCompIllustration.exe 
      end
    end
  end
end
[END REGION]
 
